package org.jiopi.ibean.show.helloworld;


import org.jiopi.framework.CentralConsole;
import org.jiopi.framework.ModuleConsole;
import org.jiopi.framework.ControlPanel;
import org.jiopi.framework.FrameworkInitializer;
public class HTTPClientTest {
	public static void main(String[] args) {
		FrameworkInitializer.initialize();
		ModuleConsole apacheHttpclient = CentralConsole.accessModuleConsole("apache.httpclient");
		ControlPanel httpclient = apacheHttpclient.accessControlPanel("org.apache.http.impl.client.DefaultHttpClient", ControlPanel.class);
		ControlPanel httphead = apacheHttpclient.accessControlPanel("org.apache.http.client.methods.HttpHead",ControlPanel.class,"http://www.javaeye.com/images/logo.gif");
		//ControlPanel httphead = apacheHttpclient.accessControlPanel("org.apache.http.client.methods.HttpHead",ControlPanel.class,"http://groups.google.com/groups/img/gicons/discuss.jpg");
		try {
			ControlPanel response = httpclient.operate("execute", ControlPanel.class, httphead);
			ControlPanel statusLine = response.operate("getStatusLine", ControlPanel.class);
			String status = statusLine.operate("toString", String.class);
			System.out.println(status);
		} catch (Exception e) {
			e.printStackTrace();
		}
		httpclient.operate("getConnectionManager", ControlPanel.class).operate("shutdown",void.class);
	}
}
